package com.linyaonan.design.singleton;

/**
 * @author: Lin
 * @date: 2020/2/2
 */
public class Singleton2 {

    private static Singleton2 s;

    private Singleton2() {

    }

    /**
     * 标准的懒汉式，不存在则进行创建，但是会存在线程安全问题
     * @return
     */
    public static Singleton2 getInstance() {
        if (s == null) {
            s = new Singleton2();
        }
        return s;
    }

}
